﻿using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http.Dependencies;

namespace Virgee.Common.Services.Tests.Support
{
    public class TestIoCContainer : TestIoCScopeContainer, IDependencyResolver
    {
        public TestIoCContainer(IUnityContainer container)
            : base(container)
        {
            // This space intentionally left blank            
        }

        public IDependencyScope BeginScope()
        {
            var child = _container.CreateChildContainer();
            
            child.RegisterType<TestApiController>();
            child.RegisterType<TestApi2Controller>();

            return new TestIoCScopeContainer(child);
        }
    }
}
